(function($){ 'use strict'; if(typeof wpcf7==='undefined'||wpcf7===null){ return; } wpcf7=$.extend({ cached: 0, inputs: [] }, wpcf7); $(function(){ wpcf7.supportHtml5=(function(){ var features={}; var input=document.createElement('input'); features.placeholder='placeholder' in input; var inputTypes=[ 'email', 'url', 'tel', 'number', 'range', 'date' ]; $.each(inputTypes, function(index, value){ input.setAttribute('type', value); features[ value ]=input.type!=='text'; }); return features; })(); $('div.wpcf7 > form').each(function(){ var $form=$(this); wpcf7.initForm($form); if(wpcf7.cached){ wpcf7.refill($form); }}); }); wpcf7.getId=function(form){ return parseInt($('input[name="_wpcf7"]', form).val(), 10); }; wpcf7.initForm=function(form){ var $form=$(form); $form.submit(function(event){ if(! wpcf7.supportHtml5.placeholder){ $('[placeholder].placeheld', $form).each(function(i, n){ $(n).val('').removeClass('placeheld'); }); } if(typeof window.FormData==='function'){ wpcf7.submit($form); event.preventDefault(); }}); $('.wpcf7-submit', $form).after(''); wpcf7.toggleSubmit($form); $form.on('click', '.wpcf7-acceptance', function(){ wpcf7.toggleSubmit($form); }); $('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function(){ var name=$(this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false); }); $('.wpcf7-list-item.has-free-text', $form).each(function(){ var $freetext=$(':input.wpcf7-free-text', this); var $wrap=$(this).closest('.wpcf7-form-control'); if($(':checkbox, :radio', this).is(':checked')){ $freetext.prop('disabled', false); }else{ $freetext.prop('disabled', true); } $wrap.on('change', ':checkbox, :radio', function(){ var $cb=$('.has-free-text', $wrap).find(':checkbox, :radio'); if($cb.is(':checked')){ $freetext.prop('disabled', false).focus(); }else{ $freetext.prop('disabled', true); }}); }); if(! wpcf7.supportHtml5.placeholder){ $('[placeholder]', $form).each(function(){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function(){ if($(this).hasClass('placeheld')){ $(this).val('').removeClass('placeheld'); }}); $(this).blur(function(){ if(''===$(this).val()){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); }}); }); } if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.date){ $form.find('input.wpcf7-date[type="date"]').each(function(){ $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }); }); } if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.number){ $form.find('input.wpcf7-number[type="number"]').each(function(){ $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }); }); } $('.wpcf7-character-count', $form).each(function(){ var $count=$(this); var name=$count.attr('data-target-name'); var down=$count.hasClass('down'); var starting=parseInt($count.attr('data-starting-value'), 10); var maximum=parseInt($count.attr('data-maximum-value'), 10); var minimum=parseInt($count.attr('data-minimum-value'), 10); var updateCount=function(target){ var $target=$(target); var length=$target.val().length; var count=down ? starting - length:length; $count.attr('data-current-value', count); $count.text(count); if(maximum&&maximum < length){ $count.addClass('too-long'); }else{ $count.removeClass('too-long'); } if(minimum&&length < minimum){ $count.addClass('too-short'); }else{ $count.removeClass('too-short'); }}; $(':input[name="' + name + '"]', $form).each(function(){ updateCount(this); $(this).keyup(function(){ updateCount(this); }); }); }); $form.on('change', '.wpcf7-validates-as-url', function(){ var val=$.trim($(this).val()); if(val && ! val.match(/^[a-z][a-z0-9.+-]*:/i) && -1!==val.indexOf('.')){ val=val.replace(/^\/+/, ''); val='http://' + val; } $(this).val(val); }); }; wpcf7.submit=function(form){ if(typeof window.FormData!=='function'){ return; } var $form=$(form); $('.ajax-loader', $form).addClass('is-active'); wpcf7.clearResponse($form); var formData=new FormData($form.get(0)); var detail={ id: $form.closest('div.wpcf7').attr('id'), status: 'init', inputs: [], formData: formData }; $.each($form.serializeArray(), function(i, field){ if('_wpcf7'==field.name){ detail.contactFormId=field.value; }else if('_wpcf7_version'==field.name){ detail.pluginVersion=field.value; }else if('_wpcf7_locale'==field.name){ detail.contactFormLocale=field.value; }else if('_wpcf7_unit_tag'==field.name){ detail.unitTag=field.value; }else if('_wpcf7_container_post'==field.name){ detail.containerPostId=field.value; }else if(field.name.match(/^_wpcf7_\w+_free_text_/)){ var owner=field.name.replace(/^_wpcf7_\w+_free_text_/, ''); detail.inputs.push({ name: owner + '-free-text', value: field.value }); }else if(field.name.match(/^_/)){ }else{ detail.inputs.push(field); }}); wpcf7.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess=function(data, status, xhr, $form){ detail.id=$(data.into).attr('id'); detail.status=data.status; detail.apiResponse=data; var $message=$('.wpcf7-response-output', $form); switch(data.status){ case 'validation_failed': $.each(data.invalidFields, function(i, n){ $(n.into, $form).each(function(){ wpcf7.notValidTip(this, n.message); $('.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $('[aria-invalid]', this).attr('aria-invalid', 'true'); }); }); $message.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); wpcf7.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': $message.addClass('wpcf7-acceptance-missing'); $form.addClass('unaccepted'); wpcf7.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': $message.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); wpcf7.triggerEvent(data.into, 'spam', detail); break; case 'aborted': $message.addClass('wpcf7-aborted'); $form.addClass('aborted'); wpcf7.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': $message.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); wpcf7.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': $message.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); wpcf7.triggerEvent(data.into, 'mailfailed', detail); break; default: var customStatusClass='custom-' + data.status.replace(/[^0-9a-z]+/i, '-'); $message.addClass('wpcf7-' + customStatusClass); $form.addClass(customStatusClass); } wpcf7.refill($form, data); wpcf7.triggerEvent(data.into, 'submit', detail); if('mail_sent'==data.status){ $form.each(function(){ this.reset(); }); wpcf7.toggleSubmit($form); } if(! wpcf7.supportHtml5.placeholder){ $form.find('[placeholder].placeheld').each(function(i, n){ $(n).val($(n).attr('placeholder')); }); } $message.html('').append(data.message).slideDown('fast'); $message.attr('role', 'alert'); $('.screen-reader-response', $form.closest('.wpcf7')).each(function(){ var $response=$(this); $response.html('').attr('role', '').append(data.message); if(data.invalidFields){ var $invalids=$(''); $.each(data.invalidFields, function(i, n){ if(n.idref){ var $li=$('
  • ').append($('').attr('href', '#' + n.idref).append(n.message)); }else{ var $li=$('
  • ').append(n.message); } $invalids.append($li); }); $response.append($invalids); } $response.attr('role', 'alert').focus(); }); }; $.ajax({ type: 'POST', url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/feedback'), data: formData, dataType: 'json', processData: false, contentType: false }).done(function(data, status, xhr){ ajaxSuccess(data, status, xhr, $form); $('.ajax-loader', $form).removeClass('is-active'); }).fail(function(xhr, status, error){ var $e=$('
    ').text(error.message); $form.after($e); }); }; wpcf7.triggerEvent=function(target, name, detail){ var $target=$(target); var event=new CustomEvent('wpcf7' + name, { bubbles: true, detail: detail }); $target.get(0).dispatchEvent(event); $target.trigger('wpcf7:' + name, detail); $target.trigger(name + '.wpcf7', detail); }; wpcf7.toggleSubmit=function(form, state){ var $form=$(form); var $submit=$('input:submit', $form); if(typeof state!=='undefined'){ $submit.prop('disabled', ! state); return; } if($form.hasClass('wpcf7-acceptance-as-validation')){ return; } $submit.prop('disabled', false); $('.wpcf7-acceptance', $form).each(function(){ var $span=$(this); var $input=$('input:checkbox', $span); if(! $span.hasClass('optional')){ if($span.hasClass('invert')&&$input.is(':checked') || ! $span.hasClass('invert')&&! $input.is(':checked')){ $submit.prop('disabled', true); return false; }} }); }; wpcf7.notValidTip=function(target, message){ var $target=$(target); $('.wpcf7-not-valid-tip', $target).remove(); $('') .text(message).appendTo($target); if($target.is('.use-floating-validation-tip *')){ var fadeOut=function(target){ $(target).not(':hidden').animate({ opacity: 0 }, 'fast', function(){ $(this).css({ 'z-index': -100 }); }); }; $target.on('mouseover', '.wpcf7-not-valid-tip', function(){ fadeOut(this); }); $target.on('focus', ':input', function(){ fadeOut($('.wpcf7-not-valid-tip', $target)); }); }}; wpcf7.refill=function(form, data){ var $form=$(form); var refillCaptcha=function($form, items){ $.each(items, function(i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match=/([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[ 1 ]); }); }; var refillQuiz=function($form, items){ $.each(items, function(i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[ 0 ]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[ 1 ]); }); }; if(typeof data==='undefined'){ $.ajax({ type: 'GET', url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/refill'), beforeSend: function(xhr){ var nonce=$form.find(':input[name="_wpnonce"]').val(); if(nonce){ xhr.setRequestHeader('X-WP-Nonce', nonce); }}, dataType: 'json' }).done(function(data, status, xhr){ if(data.captcha){ refillCaptcha($form, data.captcha); } if(data.quiz){ refillQuiz($form, data.quiz); }}); }else{ if(data.captcha){ refillCaptcha($form, data.captcha); } if(data.quiz){ refillQuiz($form, data.quiz); }} }; wpcf7.clearResponse=function(form){ var $form=$(form); $form.removeClass('invalid spam sent failed'); $form.siblings('.screen-reader-response').html('').attr('role', ''); $('.wpcf7-not-valid-tip', $form).remove(); $('[aria-invalid]', $form).attr('aria-invalid', 'false'); $('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $('.wpcf7-response-output', $form) .hide().empty().removeAttr('role') .removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked'); }; wpcf7.apiSettings.getRoute=function(path){ var url=wpcf7.apiSettings.root; url=url.replace(wpcf7.apiSettings.namespace, wpcf7.apiSettings.namespace + path); return url; };})(jQuery); (function (){ if(typeof window.CustomEvent==="function") return false; function CustomEvent(event, params){ params=params||{ bubbles: false, cancelable: false, detail: undefined }; var evt=document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype=window.Event.prototype; window.CustomEvent=CustomEvent; })(); (function(c){function p(d,b,a){var e=this,l=d.add(this),h=d.find(a.tabs),i=b.jquery?b:d.children(b),j;h.length||(h=d.children());i.length||(i=d.parent().find(b));i.length||(i=c(b));c.extend(this,{click:function(f,g){var k=h.eq(f);if(typeof f=="string"&&f.replace("#","")){k=h.filter("[href*="+f.replace("#","")+"]");f=Math.max(h.index(k),0)}if(a.rotate){var n=h.length-1;if(f<0)return e.click(n,g);if(f>n)return e.click(0,g)}if(!k.length){if(j>=0)return e;f=a.initialIndex;k=h.eq(f)}if(f===j)return e; g=g||c.Event();g.type="onBeforeClick";l.trigger(g,[f]);if(!g.isDefaultPrevented()){o[a.effect].call(e,f,function(){g.type="onClick";l.trigger(g,[f])});j=f;h.removeClass(a.current);k.addClass(a.current);return e}},getConf:function(){return a},getTabs:function(){return h},getPanes:function(){return i},getCurrentPane:function(){return i.eq(j)},getCurrentTab:function(){return h.eq(j)},getIndex:function(){return j},next:function(){return e.click(j+1)},prev:function(){return e.click(j-1)},destroy:function(){h.unbind(a.event).removeClass(a.current); i.find('a[href^="#"]').unbind("click.T");return e}});c.each("onBeforeClick,onClick".split(","),function(f,g){c.isFunction(a[g])&&c(e).bind(g,a[g]);e[g]=function(k){k&&c(e).bind(g,k);return e}});if(a.history&&c.fn.history){c.tools.history.init(h);a.event="history"}h.each(function(f){c(this).bind(a.event,function(g){e.click(f,g);return g.preventDefault()})});i.find('a[href^="#"]').bind("click.T",function(f){e.click(c(this).attr("href"),f)});if(location.hash&&a.tabs=="a"&&d.find("[href="+location.hash+"]").length)e.click(location.hash); else if(a.initialIndex===0||a.initialIndex>0)e.click(a.initialIndex)}c.tools=c.tools||{version:"1.2.5"};c.tools.tabs={conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",rotate:false,history:false},addEffect:function(d,b){o[d]=b}};var o={"default":function(d,b){this.getPanes().hide().eq(d).show();b.call()},fade:function(d,b){var a=this.getConf(),e=a.fadeOutSpeed,l=this.getPanes();e?l.fadeOut(e):l.hide();l.eq(d).fadeIn(a.fadeInSpeed,b)},slide:function(d, b){this.getPanes().slideUp(200);this.getPanes().eq(d).slideDown(400,b)},ajax:function(d,b){this.getPanes().eq(0).load(this.getTabs().eq(d).attr("href"),b)}},m;c.tools.tabs.addEffect("horizontal",function(d,b){m||(m=this.getPanes().eq(0).width());this.getCurrentPane().animate({width:0},function(){c(this).hide()});this.getPanes().eq(d).animate({width:m},function(){c(this).show();b.call()})});c.fn.fpTabs=function(d,b){var a=this.data("tabs");if(a){a.destroy();this.removeData("tabs")}if(c.isFunction(b))b= {onBeforeClick:b};b=c.extend({},c.tools.tabs.conf,b);this.each(function(){a=new p(c(this),d,b);c(this).data("tabs",a)});return b.api?a:this}})(jQuery); (function(c){var a;a=c.tools.tabs.slideshow={conf:{next:".forward",prev:".backward",disabledClass:"disabled",autoplay:false,autopause:true,interval:3000,clickable:true,api:false}};function b(k,i){var o=this,f=k.add(this),j=k.data("tabs"),e,d=true;function h(q){var p=c(q);return p.length<2?p:k.parent().find(q)}var n=h(i.next).click(function(){j.next()});var l=h(i.prev).click(function(){j.prev()});c.extend(o,{getTabs:function(){return j},getConf:function(){return i},play:function(){if(e){return o}var p=c.Event("onBeforePlay");f.trigger(p);if(p.isDefaultPrevented()){return o}m();d=false;f.trigger("onPlay");return o},pause:function(){if(!e){return o}var p=c.Event("onBeforePause");f.trigger(p);if(p.isDefaultPrevented()){return o}e=clearTimeout(e);f.trigger("onPause");return o},stop:function(){o.pause();d=true}});function m(){e=setTimeout(j.next,i.interval);j.onClick(function(p){if(p.originalEvent==null){e=clearTimeout(e);e=setTimeout(j.next,i.interval)}})}c.each("onBeforePlay,onPlay,onBeforePause,onPause".split(","),function(q,p){if(c.isFunction(i[p])){c(o).bind(p,i[p])}o[p]=function(r){return c(o).bind(p,r)}});if(i.autopause){j.getTabs().add(n).add(l).add(j.getPanes()).hover(o.pause,function(){if(!d){o.play()}})}if(i.autoplay){o.play()}if(i.clickable){j.getPanes().click(function(){j.next()})}if(!j.getConf().rotate){var g=i.disabledClass;if(!j.getIndex()){l.addClass(g)}j.onBeforeClick(function(q,p){l.toggleClass(g,!p);n.toggleClass(g,p==j.getTabs().length-1)})}}c.fn.slideshow=function(d){var e=this.data("slideshow");if(e){return e}d=c.extend({},a.conf,d);this.each(function(){e=new b(c(this),d);c(this).data("slideshow",e)});return d.api?e:this}})(jQuery); (function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('
    ');var tiptip_content=$('
    ');var tiptip_arrow=$('
    ');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('
    ')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery); (function ($){ function getViewportHeight(){ var height=window.innerHeight; var mode=document.compatMode; if((mode||!$.support.boxModel)){ height=(mode=='CSS1Compat') ? document.documentElement.clientHeight : document.body.clientHeight; } return height; } $(window).scroll(function (){ var vpH=getViewportHeight(), scrolltop=(document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop), elems=[]; $.each($.cache, function (){ if(this.events&&this.events.inview){ elems.push(this.handle.elem); }}); if(elems.length){ $(elems).each(function (){ var $el=$(this), top=$el.offset().top, height=$el.height(), inview=$el.data('inview')||false; if(scrolltop > (top + height)||scrolltop + vpH < top){ if(inview){ $el.data('inview', false); $el.trigger('inview', [ false ]); }}else if(scrolltop < (top + height)){ if(!inview){ $el.data('inview', true); $el.trigger('inview', [ true ]); }} }); }}); $(function (){ $(window).scroll(); }); })(jQuery); (function(d){var p=function(b){return b.split("").reverse().join("")},l={numberStep:function(b,a){var e=Math.floor(b);d(a.elem).text(e)}},h=function(b){var a=b.elem;a.nodeType&&a.parentNode&&(a=a._animateNumberSetter,a||(a=l.numberStep),a(b.now,b))};d.Tween&&d.Tween.propHooks?d.Tween.propHooks.number={set:h}:d.fx.step.number=h;d.animateNumber={numberStepFactories:{append:function(b){return function(a,e){var k=Math.floor(a);d(e.elem).prop("number",a).text(k+b)}},separator:function(b,a){b=b||" ";a= a||3;return function(e,k){var c=Math.floor(e).toString(),s=d(k.elem);if(c.length>a){for(var f=c,g=a,l=f.split("").reverse(),c=[],m,q,n,r=0,h=Math.ceil(f.length/g);r
    "); var canvas=$("canvas",this).get(0); if(typeof(G_vmlCanvasManager)!="undefined") G_vmlCanvasManager.initElement(canvas); var ctx=canvas.getContext('2d'); methods.drawBg.call(ctx, this.donutchartsettings); }}, drawBg:function(settings){ this.clearRect(0,0,settings.size,settings.size); this.beginPath(); this.fillStyle=settings.bgColor; this.arc(settings.size/2,settings.size/2,settings.size/2,0,2*Math.PI,false); this.arc(settings.size/2,settings.size/2,settings.size/2-settings.donutwidth,0,2*Math.PI,true); this.fill(); }, drawFg:function(settings,percent){ var ratio=percent/100 * 360; var startAngle=Math.PI*-90/180; var endAngle=Math.PI*(-90+ratio)/180; this.beginPath(); this.fillStyle=settings.fgColor; this.arc(settings.size/2,settings.size/2,settings.size/2,startAngle,endAngle,false); this.arc(settings.size/2,settings.size/2,settings.size/2-settings.donutwidth,endAngle,startAngle,true); this.fill(); }, }; $.fn.donutchart=function(method){ return this.each(function(){ methods.init.call(this, method); if(method=="animate"){ var percentage=$(this).attr("data-percent"); var canvas=$(this).children("canvas").get(0); var percenttext=$(this).children("div"); var dcs=this.donutchartsettings; if(canvas.getContext){ var ctx=canvas.getContext('2d'); var j=0; function animateDonutChart(){ j++; methods.drawBg.call(ctx,dcs); methods.drawFg.apply(ctx,[dcs,j]); percenttext.text(j+"%"); if(j >=percentage) clearInterval(animationID); } var animationID=setInterval(animateDonutChart,20); }} }) }})(jQuery); !function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";var b=window.Slick||{};b=function(){function c(c,d){var f,e=this;e.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:a(c),appendDots:a(c),arrows:!0,asNavFor:null,prevArrow:'',nextArrow:'',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(b,c){return a('").addClass(this._triggerClass).html(a?M("").attr({src:a,alt:i,title:i}):i)),e[s?"before":"after"](t.trigger),t.trigger.click(function(){return M.datepicker._datepickerShowing&&M.datepicker._lastInput===e[0]?M.datepicker._hideDatepicker():(M.datepicker._datepickerShowing&&M.datepicker._lastInput!==e[0]&&M.datepicker._hideDatepicker(),M.datepicker._showDatepicker(e[0])),!1}))},_autoSize:function(e){var t,a,i,s,n,r;this._get(e,"autoSize")&&!e.inline&&(n=new Date(2009,11,20),(r=this._get(e,"dateFormat")).match(/[DM]/)&&(n.setMonth((t=function(e){for(s=i=a=0;sa&&(a=e[s].length,i=s);return i})(this._get(e,r.match(/MM/)?"monthNames":"monthNamesShort"))),n.setDate(t(this._get(e,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-n.getDay())),e.input.attr("size",this._formatDate(e,n).length))},_inlineDatepicker:function(e,t){var a=M(e);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(t.dpDiv),M.data(e,"datepicker",t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block"))},_dialogDatepicker:function(e,t,a,i,s){var n,r=this._dialogInst;return r||(this.uuid+=1,n="dp"+this.uuid,this._dialogInput=M(""),this._dialogInput.keydown(this._doKeyDown),M("body").append(this._dialogInput),(r=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},M.data(this._dialogInput[0],"datepicker",r)),c(r.settings,i||{}),t=t&&t.constructor===Date?this._formatDate(r,t):t,this._dialogInput.val(t),this._pos=s?s.length?s:[s.pageX,s.pageY]:null,this._pos||(n=document.documentElement.clientWidth,i=document.documentElement.clientHeight,t=document.documentElement.scrollLeft||document.body.scrollLeft,s=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[n/2-100+t,i/2-150+s]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),r.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),M.blockUI&&M.blockUI(this.dpDiv),M.data(this._dialogInput[0],"datepicker",r),this},_destroyDatepicker:function(e){var t,a=M(e),i=M.data(e,"datepicker");a.hasClass(this.markerClassName)&&(t=e.nodeName.toLowerCase(),M.removeData(e,"datepicker"),"input"===t?(i.append.remove(),i.trigger.remove(),a.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):"div"!==t&&"span"!==t||a.removeClass(this.markerClassName).empty(),n===i&&(n=null))},_enableDatepicker:function(t){var e,a=M(t),i=M.data(t,"datepicker");a.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!1,i.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==e&&"span"!==e||((a=a.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=M.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var e,a=M(t),i=M.data(t,"datepicker");a.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!0,i.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==e&&"span"!==e||((a=a.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=M.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;td&&ic&&st;)--B<0&&(B=11,J--);for(e.drawMonth=B,e.drawYear=J,E=this._get(e,"prevText"),E=L?this.formatDate(E,this._daylightSavingAdjust(new Date(J,B-A,1)),this._getFormatConfig(e)):E,a=this._canAdjustMonth(e,-1,J,B)?""+E+"":R?"":""+E+"",E=this._get(e,"nextText"),E=L?this.formatDate(E,this._daylightSavingAdjust(new Date(J,B+A,1)),this._getFormatConfig(e)):E,i=this._canAdjustMonth(e,1,J,B)?""+E+"":R?"":""+E+"",R=this._get(e,"currentText"),E=this._get(e,"gotoCurrent")&&e.currentDay?P:K,R=L?this.formatDate(R,E,this._getFormatConfig(e)):R,L=e.inline?"":"",L=O?"
    "+(j?L:"")+(this._isInRange(e,E)?"":"")+(j?"":L)+"
    ":"",s=parseInt(this._get(e,"firstDay"),10),s=isNaN(s)?0:s,n=this._get(e,"showWeek"),r=this._get(e,"dayNames"),d=this._get(e,"dayNamesMin"),c=this._get(e,"monthNames"),o=this._get(e,"monthNamesShort"),l=this._get(e,"beforeShowDay"),h=this._get(e,"showOtherMonths"),u=this._get(e,"selectOtherMonths"),p=this._getDefaultDate(e),g="",f=0;f"+(/all|left/.test(y)&&0===f?j?i:a:"")+(/all|right/.test(y)&&0===f?j?a:i:"")+this._generateMonthYearHeader(e,B,J,U,z,0",M=n?"":"",_=0;_<7;_++)M+="";for(v+=M+"",C=this._getDaysInMonth(J,B),J===e.selectedYear&&B===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,C)),w=(this._getFirstDayOfMonth(J,B)-s+7)%7,C=Math.ceil((w+C)/7),I=H&&this.maxRows>C?this.maxRows:C,this.maxRows=I,x=this._daylightSavingAdjust(new Date(J,B,1-w)),Y=0;Y",S=n?"":"",_=0;_<7;_++)N=l?l.apply(e.input?e.input[0]:null,[x]):[!0,""],T=(F=x.getMonth()!==B)&&!u||!N[0]||U&&x"+(F&&!h?" ":T?""+x.getDate()+"":""+x.getDate()+"")+"",x.setDate(x.getDate()+1),x=this._daylightSavingAdjust(x);v+=S+""}11<++B&&(B=0,J++),k+=v+="
    "+this._get(e,"weekHeader")+""+d[b]+"
    "+this._get(e,"calculateWeek")(x)+"
    "+(H?""+(0":""):"")}g+=k}return g+=L,e._keyEvent=!1,g},_generateMonthYearHeader:function(e,t,a,i,s,n,r,d){var c,o,l,h,u,p,g,_=this._get(e,"changeMonth"),f=this._get(e,"changeYear"),k=this._get(e,"showMonthAfterYear"),D="
    ",m="";if(n||!_)m+=""+r[t]+"";else{for(c=i&&i.getFullYear()===a,o=s&&s.getFullYear()===a,m+=""}if(k||(D+=m+(!n&&_&&f?"":" ")),!e.yearshtml)if(e.yearshtml="",n||!f)D+=""+a+"";else{for(h=this._get(e,"yearRange").split(":"),u=(new Date).getFullYear(),p=(r=function(e){e=e.match(/c[+\-].*/)?a+parseInt(e.substring(1),10):e.match(/[+\-].*/)?u+parseInt(e,10):parseInt(e,10);return isNaN(e)?u:e})(h[0]),g=Math.max(p,r(h[1]||"")),p=i?Math.max(p,i.getFullYear()):p,g=s?Math.min(g,s.getFullYear()):g,e.yearshtml+="",D+=e.yearshtml,e.yearshtml=null}return D+=this._get(e,"yearSuffix"),k&&(D+=(!n&&_&&f?"":" ")+m),D+="
    "},_adjustInstDate:function(e,t,a){var i=e.drawYear+("Y"===a?t:0),s=e.drawMonth+("M"===a?t:0),t=Math.min(e.selectedDay,this._getDaysInMonth(i,s))+("D"===a?t:0),t=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(i,s,t)));e.selectedDay=t.getDate(),e.drawMonth=e.selectedMonth=t.getMonth(),e.drawYear=e.selectedYear=t.getFullYear(),"M"!==a&&"Y"!==a||this._notifyChange(e)},_restrictMinMax:function(e,t){var a=this._getMinMaxDate(e,"min"),e=this._getMinMaxDate(e,"max"),t=a&&t=a.getTime())&&(!i||t.getTime()<=i.getTime())&&(!s||t.getFullYear()>=s)&&(!n||t.getFullYear()<=n)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return{shortYearCutoff:t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,a,i){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);t=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(i,a,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),t,this._getFormatConfig(e))}}),M.fn.datepicker=function(e){if(!this.length)return this;M.datepicker.initialized||(M(document).mousedown(M.datepicker._checkExternalClick),M.datepicker.initialized=!0),0===M("#"+M.datepicker._mainDivId).length&&M("body").append(M.datepicker.dpDiv);var t=Array.prototype.slice.call(arguments,1);return"string"==typeof e&&("isDisabled"===e||"getDate"===e||"widget"===e)||"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?M.datepicker["_"+e+"Datepicker"].apply(M.datepicker,[this[0]].concat(t)):this.each(function(){"string"==typeof e?M.datepicker["_"+e+"Datepicker"].apply(M.datepicker,[this].concat(t)):M.datepicker._attachDatepicker(this,e)})},M.datepicker=new e,M.datepicker.initialized=!1,M.datepicker.uuid=(new Date).getTime(),M.datepicker.version="1.11.4",M.datepicker}); jQuery(window).on('load', function(){ if(jQuery('#appointment-step-checker').val()!='false'){ jQuery('#appointment-step').val(1); }else{ jQuery('#appointment-step').val(2); }}); jQuery(document).ready(function($){ $(".dt-select-service").change(function(){ var $id=$(this).val(); $.ajax({ method:'POST', url: dttheme_urls.ajaxurl, type: 'html', data:{ action: 'tanj_fill_staffs', service_id :$id }, complete: function(response){ if(response.status===200){ var $append=""; if($.trim(response.responseText).length > 0){ $append +=response.responseText; $(".dt-select-staff").empty().append($append); }} }}); }); $('#datepicker').datepicker({ minDate: 0, dateFormat:'yy-mm-dd' }) if($('body').hasClass('page-template-tpl-reservation-type2-php')){ $("body").delegate(".appointment-goback","click",function(e){ $('.steps').hide(); var curr_step_val=$('#appointment-step').val(); var step_to_show=parseInt(curr_step_val, 10) - 1; $('.dt-sc-schedule-progress-wrapper .step'+curr_step_val).removeClass('dt-sc-current-step'); $('.dt-sc-schedule-progress-wrapper .step'+step_to_show).removeClass('dt-sc-completed-step'); $('.dt-sc-schedule-progress-wrapper .step'+step_to_show).addClass('dt-sc-current-step'); $('.step' + step_to_show).fadeIn(800); $('#appointment-step').val(step_to_show); if(step_to_show==1){ $('.dt-sc-goback-box').hide(); }}); function tanj_calculate_step_value(){ $('.dt-sc-goback-box').show(); var curr_step_val=$('#appointment-step').val(); var updated_step_val=parseInt(curr_step_val, 10) + 1; $('.dt-sc-schedule-progress-wrapper .dt-sc-schedule-progress').removeClass('dt-sc-current-step'); $('.dt-sc-schedule-progress-wrapper .step'+curr_step_val).addClass('dt-sc-completed-step'); $('.dt-sc-schedule-progress-wrapper .step'+updated_step_val).addClass('dt-sc-current-step'); $('#appointment-step').val(updated_step_val); if(updated_step_val==4||updated_step_val==1){ $('.appointment-goback').hide(); $('.dt-sc-goback-box').hide(); }} $('form[name="dt-sc-appointment-contactdetails-form"]').on('submit', function (){ var $firstname=$('#firstname').val(); var $lastname=$('#lastname').val(); var $phone=$('#phone').val(); var $emailid=$('#emailid').val(); var $address=$('#address').val(); var $about_your_project=$('#about_your_project').val(); $('#hid_firstname').val($firstname); $('#hid_lastname').val($lastname); $('#hid_phone').val($phone); $('#hid_emailid').val($emailid); $('#hid_address').val($address); $('#hid_about_your_project').val($about_your_project); var contact_details='
      '; if($firstname!=''){ contact_details +='
    • Name:

      ' + $firstname + ' ' + $lastname + '

    • '; } if($phone!=''){ contact_details +='
    • Phone:

      ' + $phone + '

    • '; } if($emailid!=''){ contact_details +='
    • Email:

      ' + $emailid + '

    • '; } if($address!=''){ contact_details +='
    • Address:

      ' + $address + '

    • '; } if($about_your_project!=''){ contact_details +='
    • Message:

      ' + $about_your_project + '

    • '; } contact_details +='
    '; $('#dt-sc-contact-info').html(contact_details); $('.dt-sc-contactdetails-box').hide(); $('.dt-sc-aboutproject-box').show(); $('.dt-sc-notification-box').show(); tanj_calculate_step_value(); return false; }); $("body").delegate(".generate-schedule","click",function(e){ var $serviceid=$('#serviceid').val(); var $staffid=$('#staffid').val(); var $staffids=$('#staffids').val(); var $aptdatepicker=$('#datepicker').val(); if($aptdatepicker=="Select Date"||$serviceid.length==""){ alert(dtAppointmentCustom.eraptdatepicker); return false; } $.ajax({ method:'POST', url: dttheme_urls.ajaxurl, type: 'html', data:{ action: 'tanj_dt_generate_schedule', serviceid :$serviceid, staffid :$staffid, staffids :$staffids, datepicker :$aptdatepicker }, beforeSend: function(){ $(".dt-sc-timeslot-box").hide(); }, complete: function(response){ $(".appointment-ajax-holder").html(response.responseText); $(".dt-sc-timeslot-box").fadeIn(800); $('html, body').animate({ scrollTop: $('.dt-sc-timeslot-box').offset().top - 200 },2000); }}); }); $("body").delegate("a.time-slot","click",function(e){ e.preventDefault(); var $daydate=$(this).data('daydate'), $time=$(this).data('time'), $service=$('*[name=serviceid] :selected').text(), $staff=$(this).data('staffname'); var schedule_details='
      '; if($service!=''){ schedule_details +='
    • Department:

      ' + $service + '

    • '; } if($staff!=''){ schedule_details +='
    • Staff:

      ' + $staff + '

    • '; } if($daydate!=''){ schedule_details +='
    • Date:

      ' + $daydate + '

    • '; } if($time!=''){ schedule_details +='
    • Time:

      ' + $time + '

    • '; } schedule_details +='
    '; $('#dt-sc-schedule-details').html(schedule_details); $('.dt-sc-schedule-box').hide(); $('.dt-sc-contactdetails-box').fadeIn(800); $("a.time-slot").removeClass('selected'); $(this).addClass('selected'); $("ul.time-table").find('li,ul.time-slots').removeClass('selected'); $(this).parentsUntil("ul.time-table").addClass('selected'); tanj_calculate_step_value(); }); $(".dt-sc-about-project-form .schedule-it").on('click', function(e){ e.preventDefault(); $staffid=$('a.time-slot.selected').data('staffid'); $serviceid=$('a.time-slot.selected').data('serviceid'); $start=$('a.time-slot.selected').data('start'); $end=$('a.time-slot.selected').data('end'); $date=$('a.time-slot.selected').data('date'); $time=$('a.time-slot.selected').data('time'); $firstname=$(".dt-sc-aboutproject-box #hid_firstname").val(); $lastname=$(".dt-sc-aboutproject-box #hid_lastname").val(); $phone=$(".dt-sc-aboutproject-box #hid_phone").val(); $emailid=$(".dt-sc-aboutproject-box #hid_emailid").val(); $address=$(".dt-sc-aboutproject-box #hid_address").val(); $about_your_project=$(".dt-sc-aboutproject-box #hid_about_your_project").val(); if(typeof($start)!='undefined'){ $.ajax({ method: 'POST', url: dttheme_urls.ajaxurl, data: { action: "tanj_dttheme_new_reservation", staffid: $staffid, serviceid: $serviceid, start: $start, end: $end, date: $date, time: $time, firstname: $firstname, lastname: $lastname, phone: $phone, emailid: $emailid, address: $address, aboutyourproject: $about_your_project, }, dataType: 'json', beforeSend: function(){ $('#dt-sc-ajax-load-image').show(); }, success: function(response){ $('.dt-sc-notification-box').show(); if(response=='Success'){ $('.dt-sc-apt-success-box').fadeIn(800); }else{ $('.dt-sc-apt-error-box').fadeIn(800); }}, complete: function(){ $('#dt-sc-ajax-load-image').hide(); tanj_calculate_step_value(); }}); }else{ $("a.schedule-it").hide(); }}); } jQuery('.select_start').on('change', function(){ var $row=jQuery(this).parent(), $start_select=jQuery(this), $end_select=jQuery('.select_end', $row); if($start_select.val()){ $end_select.show(); }else{ $end_select.hide(); $start_select.find('option[selected="selected"]').removeAttr('selected'); $end_select.find('option[selected="selected"]').removeAttr('selected'); } jQuery('option', $end_select).each(function (){ jQuery(this).show(); }); var start_time=$start_select.val(); $current=$end_select.data('current'); jQuery('option', $end_select).each(function(){ if(jQuery(this).val() <=start_time){ jQuery(this).hide(); jQuery(this).removeAttr('selected'); if($current < jQuery(this).val()){ jQuery('option:visible:first', $end_select).attr('selected', 'selected'); }}else if(!$current||$current=='00:00'){ jQuery('option:visible:first', $end_select).attr('selected', 'selected'); }}); }).each(function(){ var $row=jQuery(this).parent(), $start_select=jQuery(this), $end_select=jQuery('.select_end', $row); if(!jQuery(this).val()){ $end_select.hide(); $start_select.find('option[selected="selected"]').removeAttr('selected'); $end_select.find('option[selected="selected"]').removeAttr('selected'); }}).trigger('change'); $(".start-time").change(function(){ var $s_time=$(this).val(), $last=$('option:last', $(this)); $(".end-time").empty(); if($(this)[0].selectedIndex < $last.index()){ $('option', this).each(function (){ if($(this).val() > $s_time){ $(".end-time").append($(this).clone()); }}); }else{ $(".end-time").append($last.clone()).val($last.val()); }}); $(".show-time-shortcode").on('click', function(e){ $date=$("*[name=date]").val(); $stime=$('*[name=start-time]').val(); $etime=$('*[name=end-time]').val(); $staff=$('*[name=staff]').val(); $service=$('*[name=services]').val(); if($staff.length > 0||$service.length > 0){ $(".dt-sc-reservation-form").submit(); }else{ alert("Please choose Service"); } e.preventDefault(); }); function tanj_staff_reservation(){ $date=$("*[name=date]").val(); $stime=$('*[name=start-time]').val(); $etime=$('*[name=end-time]').val(); $staff=$('*[name=staff]').val(); $service=$('*[name=services]').val(); if($staff.length > 0||$service.length > 0){ $.ajax({ method:'POST', url: dttheme_urls.ajaxurl, type: 'html', data:{ action: 'tanj_available_times', date :$date, stime:$stime, etime:$etime, staffid:$staff, staff: $('*[name=staff] :selected').text(), serviceid:$service, service:$('*[name=services] :selected').text() }, complete: function(response){ if(response.status===200){ var $append=""; if($.trim(response.responseText).length > 0){ $append +=response.responseText; $(".available-times").empty().append($append); }} }}); }else{ alert("Please choose Service"); }} $(".start-time").each(function(){ $service=$('*[name=services]').val(); if($service.length > 0){ tanj_staff_reservation(); }}); $(".show-time").on('click', function(e){ tanj_staff_reservation(); e.preventDefault(); }); if($('body').hasClass('page-template-tpl-reservation-php')){ $("body").delegate("a.time-slot","click",function(e){ e.preventDefault(); $("div.personal-info").show(); $('html, body').animate({ scrollTop: $('#personalinfo').offset().top + 500 },2000); $("div.choose-payment").show(); $("a.time-slot").removeClass('selected'); $(this).addClass('selected'); $("ul.time-table").find('li,ul.time-slots').removeClass('selected'); $(this).parentsUntil("ul.time-table").addClass('selected'); }); } $("body").delegate("select[name='payment_type']",'change',function(e){ $val=$(this).val(); if($val.length > 0){ $("a.schedule-it").show(); }else{ $("a.schedule-it").hide(); }}); $("a.schedule-it").on('click', function(e){ e.preventDefault(); $staff=$('a.time-slot.selected').data('sid'); $service=$('*[name=services]').val(); $start=$('a.time-slot.selected').data('start'); $end=$('a.time-slot.selected').data('end'); $date=$('a.time-slot.selected').data('date'); $time=$('a.time-slot.selected').data('time'); $name=$("div.personal-info").find('input[name=name]').val(); $email=$("div.personal-info").find('input[name=email]').val(); $phone=$("div.personal-info").find('input[name=phone]').val(); $body=$("div.personal-info").find('textarea[name=note]').val(); $captcha=$("div.personal-info").find('input[name=captcha]').val(); $hcaptcha=$("div.personal-info").find('input[name=hiddencaptcha]').val(); if($name.length==""){ alert("Please enter name"); return false; } if($email.length==""){ var emailReg=/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; if(emailReg.test($email)){ alert('Please enter valid email'); return false; }} if($phone.length < 5){ alert("Please enter Phone number"); return false; } if($captcha.length <=0){ alert("Please enter captcha"); return false; } if($captcha!==$hcaptcha){ alert("Please verify entered captcha"); return false; } $payment=$("select[name='payment_type']").val(); $action=($payment==="paypal") ? "tanj_paypal_request":"tanj_new_reservation"; if(typeof($start)!='undefined'){ $.ajax({ method: 'POST', url: dttheme_urls.ajaxurl, data: { action: $action, staff: $staff, service:$service, start: $start, end: $end, name: $name, email: $email, phone: $phone, body: $body, date: $date, time: $time }, dataType: 'json', success: function(response){ window.location=response.url; }}); }else{ $("a.schedule-it").hide(); }}); }); !function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,s,a){function u(t,e,o){var n,s="$()."+i+'("'+e+'")';return t.each(function(t,u){var h=a.data(u,i);if(!h)return void r(i+" not initialized. Cannot call methods, i.e. "+s);var d=h[e];if(!d||"_"==e.charAt(0))return void r(s+" is not a valid method");var l=d.apply(h,o);n=void 0===n?l:n}),void 0!==n?n:t}function h(t,e){t.each(function(t,o){var n=a.data(o,i);n?(n.option(e),n._init()):(n=new s(o,e),a.data(o,i,n))})}a=a||e||t.jQuery,a&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=n.call(arguments,1);return u(this,t,e)}return h(this,t),this},o(a))}function o(t){!t||t&&t.bridget||(t.bridget=i)}var n=Array.prototype.slice,s=t.console,r="undefined"==typeof s?function(){}:function(t){s.error(t)};return o(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},o=i[t]=i[t]||[];return o.indexOf(e)==-1&&o.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},o=i[t]=i[t]||{};return o[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=i.indexOf(e);return o!=-1&&i.splice(o,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var o=this._onceEvents&&this._onceEvents[t],n=0;n